package com.zk.iotgateway.quartz.CustomQuartz;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.text.SimpleDateFormat;

/**
 *
 * 定时
 */
public class JobDemo1 implements Job{



  @Override
  public void execute(JobExecutionContext context) throws JobExecutionException {
    System.out.println("JobDemo1：启动任务=======================");
    run();
    System.out.println("JobDemo1：下次执行时间====="+
        new SimpleDateFormat("yyyy-MM-dd hh:mm:ss")
            .format(context.getNextFireTime())+"==============");
  }

  public void run(){
    System.out.println("任务demo1---------");
    System.out.println(this.getClass());
    System.out.println("JobDemo1：执行完毕=======================");

  }
}
